package com.qf.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qf.bean.Student;
import com.qf.bean.Student2;
import com.qf.dao.Student2Dao;
import com.qf.service.Student2Service;
import com.qf.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 2019/12/6
 * Administrator
 * springboot1204
 * 面向对象面向君  不负代码不负卿
 */
@Service
public class Student2ServiceImpl implements Student2Service {
  @Autowired
  private Student2Dao student2Dao;

  @Override
  public List<Student2> findstudentsbyIds(int[] ids) {
    return student2Dao.findstudentsbyIds(ids);
  }

  @Override
    public PageInfo<Student2> findstudent2(int pageindex,int pagesize) {
      //1.
      PageHelper.startPage(pageindex,pagesize);
//2.
      List<Student2> student2List = student2Dao.findstudent2();
  //3.
      PageInfo<Student2> student2PageInfo = new PageInfo<>(student2List);
      return student2PageInfo;
    }
}
